CREATE TABLE [dbo].[TblContract]
(
[ID] [uniqueidentifier] NOT NULL,
[ContractDate] [datetime] NULL,
[ContractNumber] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VillageId] [uniqueidentifier] NOT NULL,
[AdvisorName] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserId] [uniqueidentifier] NOT NULL,
[ContractType] [bit] NULL,
[Year] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
ALTER TABLE [dbo].[TblContract] ADD
CONSTRAINT [FK_TblContract_aspnet_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[aspnet_Users] ([UserId])
ALTER TABLE [dbo].[TblContract] WITH NOCHECK ADD
CONSTRAINT [FK_TblContract_TblVillage] FOREIGN KEY ([VillageId]) REFERENCES [dbo].[TblVillage] ([ID]) ON DELETE CASCADE ON UPDATE CASCADE

GO
ALTER TABLE [dbo].[TblContract] ADD CONSTRAINT [PK_TblContract] PRIMARY KEY CLUSTERED  ([ID]) ON [PRIMARY]
GO
